<h1><span></span><?= lang('label_deal_details') . ' (' . strtoupper($details->inv_num) . ')' ?></h1>

<ul class="breadcrumb">
    <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
    <li><a href="<?= base_url("store") ?>"><?= lang('label_menu_link_mystore') ?></a></li>
    <li><a href="<?= base_url("store/deals") ?>"><?= lang('label_deals') ?></a></li>
    <li><?= lang('label_deal_details') . ' (' . strtoupper($details->inv_num) . ')' ?></li>
</ul>


<div class="page">
    <?php if (count($details) > 0) { ?>
        <form action="<?= current_url() ?>" method="post">
            <div class="invoice">
            <b>&raquo; <?= lang('label_invoices_id') ?> :</b>  <?= strtoupper($details->inv_num) ?>
            <br /><b>&raquo; <?= lang('label_product_name') ?> :</b>  <a href="<?= base_url('products/view/' . $details->product_id) ?>" target="_blank"><?= $details->title ?></a>
            <br /><b>&raquo; <?= lang('label_product_price') ?> :</b><?= $details->price ?>
            <br /><b>&raquo; <?= lang('label_wallet_amount') ?> :</b><?= $details->amount ?>
            <br /><b>&raquo; <?= lang('label_shiping_total') ?> :</b><?= $details->shiping ?>
            <?php if ($details->get_by_hand == 'YES') { ?>
                (<?= lang('label_note') . ': ' . lang('label_get_by_hand') ?>)
            <?php } elseif ($details->cash_on_delivery == 'YES') { ?>
                (<?= lang('label_note') . ': ' . lang('label_cash_on_delivery') ?>)
            <?php } ?>
            <br /><b>&raquo; <?= lang('label_discount_total') ?> :</b>
            <?php if ($data->accept == 'NO' && $data->canceled == 'NO') { ?>
                <input type="number" name="discount" value="<?= $details->discount ?>"><?= lang('label_rial') ?>
            <?php } else { ?>
                <?= $details->discount ?>
            <?php } ?>
            <br /><b>&raquo; <?= lang('label_inv_total') ?> :</b><?= $details->total_price ?>
            <?php if ($details->color) { ?>
                <br /><b>&raquo; <?= lang('label_product_color') ?> :</b><?= $details->color ?>
            <?php } ?>
            <?php if ($details->size) { ?>
                <br /><b>&raquo; <?= lang('label_product_size') ?> :</b><?= $details->size ?>
            <?php } ?>
            <?php if ($details->get_by_hand == 'NO') { ?>
                <br /><b>&raquo; <?= lang('label_address') ?> :</b>  <?= $details->address ?>
                <br /><b>&raquo; <?= lang('label_menu_link_city') ?> :</b>  <?= get_city_name_id($details->city_id) ?>
                <br /><b>&raquo; <?= lang('label_mobile') ?> :</b>  <?= $details->mobile ?>
            <?php } ?>
</div>

            <div class="submit">
                <?php if ($data->accept == 'YES') { ?>
                    <h4 style="color: green"><?= lang('label_you_accept') ?></h4>
                    <?php if ($data->sent == 'NO' && $data->type == 'SEND') { ?>
                    <input name="submit" value="<?= lang('label_shiping_details') ?>" type="button" onclick="location.href = '<?= base_url("store/shipingdetails/$data->id/$data->inv_num") ?>'"  >
                    <?php } ?>
                <?php } elseif ($data->canceled == 'YES') { ?>
                    <h4 style="color: red"><?= lang('label_you_refuse') ?></h4>
                <?php } else { ?>
                    <input name="submit" value="<?= lang('accept_deal') ?>" type="submit"  >
                    <input name="submit" value="<?= lang('cancel_deal') ?>" type="submit"  >
                <?php } ?>
            </div>

        </form>
    <?php } else { ?>
        <div class="unsaved">
            <img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/unsaved.png" alt="" />
            <br /><?= lang('message_dont_have_subscribers') ?>
        </div>
        <br /><br /><br /><br />
    <?php } ?>
</div>
